#include "entitydeclarative.h"

using namespace Opl::Core;
QString EntityDeclarative::ID = "EntityDeclarative";

QScriptValue EntityDeclarative::toScriptValue(QScriptEngine *engine, EntityDeclarative* const &in)
{
    return engine->newQObject(in);
}

void EntityDeclarative::fromScriptValue(const QScriptValue &object, EntityDeclarative* &out)
{
    out = qobject_cast<EntityDeclarative*>(object.toQObject());
}

QScriptValue EntityDeclarative::construct_Script(QScriptContext *context, QScriptEngine *engine)
{
	return engine->newQObject(new EntityDeclarative(0));
}

EntityDeclarative::EntityDeclarative(EntityDeclarative *parent) :
	QDeclarativeItem(parent), Entity()
{
}

EntityDeclarative::~EntityDeclarative()
{

}

QString EntityDeclarative::toString()
{
	return QString("[%1(id:%2 stamp:%3 tag:%4)]").arg(metaObject()->className()).arg(unique().toString()).arg(stamp().toMSecsSinceEpoch()).arg(tag().typeName());
}
